package com.cjh.vo;

import lombok.Data;

@Data

public class ResultMap {

	private int code;

    private String msg;
    
    private Object data;
    
    private int count;

	private ResultMap(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	private ResultMap(int code, String msg, Object data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	private ResultMap(int code, String msg, Object data, int count) {
		this.code = code;
		this.msg = msg;
		this.data = data;
		this.count = count;
	}

	public static ResultMap ok(int code,String msg){
		ResultMap resultMap=new ResultMap(code,msg);

		return resultMap;
	}

	public static ResultMap ok(int code,String msg,Object data){
		ResultMap resultMap=new ResultMap(code,msg,data);

		return resultMap;
	}

	public static ResultMap ok(int code,String msg,Object data,int count){
		ResultMap resultMap=new ResultMap(code,msg,data,count);

		return resultMap;
	}

	public static ResultMap fail(int code,String msg){
		ResultMap resultMap=new ResultMap(code,msg);

		return resultMap;
	}

	public static ResultMap fail(int code,String msg,Object data){
		ResultMap resultMap=new ResultMap(code,msg,data);

		return resultMap;
	}

	public static ResultMap fail(int code,String msg,Object data,int count){
		ResultMap resultMap=new ResultMap(code,msg,data,count);

		return resultMap;
	}

}